package com.llho.core.bo.impl;

import java.util.List;

import com.llho.core.bo.ProductBo;
import com.llho.core.dao.ProductDAO;
import com.llho.core.domain.Catalog;
import com.llho.core.domain.Product;

public class ProductBoImpl implements ProductBo {
	
	ProductDAO productDAO;
	// DI via Spring 
	public void setProductDAO(ProductDAO productDAO){
		this.productDAO = productDAO;
	}

	@Override
	public Product getById(Long id) {
		return productDAO.getById(id);
	}
	
	@Override
	public List<Product> getByCatalog(Catalog entity) {
		return productDAO.getByCatalog(entity);
	}

	@Override
	public List<Product> getAll() {
		return productDAO.getAll();
	}

	@Override
	public void addNew(Product entity) {
		productDAO.addNew(entity);
	}

	@Override
	public void update(Product entity) {
		productDAO.update(entity);
	}

	@Override
	public void delete(Product entity) {
		productDAO.delete(entity);
	}

}
